package com.lapula.crazyface.entity;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.PointF;

import com.lapula.crazyface.R;
import com.lapula.crazyface.util.ImageUtils;

public class BlinkEmotion extends Emotion {

	private final String expressionFolder = "expression/blink";
	
	public BlinkEmotion(Context context) {
		super(context);
	}

	@Override
	protected void init() {
		List<Bitmap> leftEyes = new ArrayList<Bitmap>();
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_01.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_02.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_03.png"));
		leftEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_04.png"));
		OffsetRatio leftOffset = new OffsetRatio(-0.5f, -0.5f);
		ExpressionItem leftItem = new ExpressionItem(leftEyes, leftOffset, BASED_POINT_LEFT_EYE);
		expressioItems.add(leftItem);

		List<Bitmap> rightEyes = new ArrayList<Bitmap>();
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_01.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_02.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_03.png"));
		rightEyes.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "blink_04.png"));
		OffsetRatio rightOffset = new OffsetRatio(-0.5f, -0.5f);
		ExpressionItem rightItem = new ExpressionItem(rightEyes, rightOffset, BASED_POINT_RIGHT_EYE);
		expressioItems.add(rightItem);
		
		List<Bitmap> guang = new ArrayList<Bitmap>();
		guang.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "guang_01.png"));
		guang.add(ImageUtils.getImageFromAssetsFile(context, expressionFolder + "/" + "guang_02.png"));
		OffsetRatio guangOffset = new OffsetRatio(-1.0f, -1.3f);
		ExpressionItem guangItem = new ExpressionItem(guang, guangOffset, BASED_POINT_LEFT_EYE);
		expressioItems.add(guangItem);
	}
}
